package org.tis.tools.abf.module.ac.service;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import org.tis.tools.abf.module.ac.controller.request.AcDeleteListRequest;
import org.tis.tools.abf.module.ac.controller.request.AcOperatorAddRequest;
import org.tis.tools.abf.module.ac.controller.request.AcOperatorSetPassWorldRequest;
import org.tis.tools.abf.module.ac.controller.request.AcOperatorStatusRequest;
import org.tis.tools.abf.module.ac.entity.AcOperator;
import org.tis.tools.abf.module.ac.exception.AcOperatorManagementException;

import java.util.List;
import java.util.Map;

/**
 * acOperator的Service接口类
 * 
 * @author Auto Generate Tools
 * @date 2018/04/23
 */
public interface IAcOperatorService extends IService<AcOperator>  {

    void addAcOperator(AcOperatorAddRequest acOperatorAddRequest) throws AcOperatorManagementException;

    AcOperator updateAcOperatorByCondition(AcOperator acOperator) throws AcOperatorManagementException;

    /**
     * 改变操作员状态
     * @param acOperatorStatusRequest
     * @return
     * @throws AcOperatorManagementException
     */
    AcOperator changeOperatorStatus(AcOperatorStatusRequest acOperatorStatusRequest) throws AcOperatorManagementException;

    /**
     * 查询所有操作员
     * @return
     * @throws AcOperatorManagementException
     */
    List<AcOperator> queryAllOperator() throws AcOperatorManagementException;

    /**
     * 删除操作员
     * @param id
     * @throws AcOperatorManagementException
     */
    void moveOperator(String id) throws AcOperatorManagementException;

    /**
     * 批量删除操作员
     * @param listRequest
     * @throws AcOperatorManagementException
     */
    void batchDelete(AcDeleteListRequest listRequest) throws AcOperatorManagementException;

    /**
     * 根据条件查询角色下的操作员
     * @param roleId
     * @return
     * @throws AcOperatorManagementException
     */
    Page<AcOperator> queryByRole (String roleId, Page<AcOperator> page, EntityWrapper<AcOperator> wrapper) throws
            AcOperatorManagementException;

    /**
     * 修改密码
     * @param acOperator
     * @return
     * @throws AcOperatorManagementException
     */
    AcOperator changePassword(AcOperator acOperator)throws AcOperatorManagementException;

    /**
     * 对外提供的修改/重置密码
     */
    void changePasswordApi(AcOperator acOperator,AcOperatorSetPassWorldRequest passWorldRequest)throws AcOperatorManagementException;

    /**
     * 重置密码
     * @param id
     * @return
     * @throws AcOperatorManagementException
     */
    AcOperator resetPassword(String id)throws AcOperatorManagementException;

    /**
     * 员工入职时绑定操作员,查询所有未被绑定的操作员
     * @return
     * @throws AcOperatorManagementException
     */
    List<AcOperator> queryOperatorForEmployee() throws AcOperatorManagementException;

    /**
     * 根据userId查询操作员
     * @return
     * @throws AcOperatorManagementException
     */
    AcOperator queryByUserId(String userId)throws AcOperatorManagementException;

    /**
     * 对外提供查询操作员的行为
     */
    Map<String,List<String>> queryBehavesByOperator(AcOperator acOperator)throws AcOperatorManagementException;

    /**
     * 对外提供查询操作员的菜单,行为,个性化配置
     */
    Map<String,Object> queryMenuByOperator(AcOperator acOperator)throws AcOperatorManagementException;

    /**
     * 新增时判断用户名是存在
     */
    Boolean existAddUserId(String userId)throws AcOperatorManagementException;

    /**
     * 修改时判断用户名是存在
     */
    Boolean existUpdateUserId(String userId, String guid)throws AcOperatorManagementException;
}

